<template>
  <div class="newbox" @click="clickItem({id:itemObj.id,cid:itemObj.classid})">
      <img :src="itemObj.picurl" alt="">
      <div class="title">
        {{itemObj.title}}
      </div>
  </div>
</template>

<script>
export default {
  props: {
    itemObj: {
      type: Object,
      default: () => {}
    }
  },
  methods: {
    clickItem (obj) {
      this.$router.push({ path: '/detail', query: obj })
    }
  }
}
</script>

<style lang="less" scoped>
.newbox{
  width: 100%;
  padding: 0.1rem;
  background-color: #fff;
  border: 1px solid#DCDCDC;
  break-inside: avoid;
  margin-bottom: 0.15rem;
  img{
    width: 100%;
    display: block;
  }
  .title{
    font-size: 0.32rem;
    padding: 0.2rem 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
  }
}
</style>
